package weiyunsuan;

import java.util.Scanner;

public class _01杨辉三角形 {
    public static void main(String[] args) {
        Scanner sc = new Scanner(System.in);
        int nextInt = sc.nextInt();
        paint(nextInt);
    }


    private static void paint(int count) {
        int[][] init = new int[count][count];
        for (int i = 0; i < count; i ++){
            if (i==0){
                init[0][0]= 1;
            }else if (i == 1){
                init[1][0] = 1;
                init[1][1] = 1;
            }else {
                for (int column = 0 ; column <= i ; column++){
                    if (column == 0){
                        init[i][0] = 1;
                    }else if (column == i){
                        init[i][column] = 1;
                    }else {
                        init[i][column] = init[i-1][column] + init[i-1][column-1];
                    }
                }
            }
        }
        print(init);
    }

    private static void print(int[][] init) {
        for (int row = 0 ; row < init.length ; row++){
            for (int column = 0 ; column <=row ; column++){
                System.out.print(init[row][column] + " ");
            }
            System.out.println();
        }
    }
}
